package d1_inner_class1;

public class Outer {
    // 成员内部类
    private int age=99;
    public static String a;
    public class Inner{
        private String name;
        public static String schoolname; // 内部类从JDK16才开始支持定义静态成员
        private int age = 88;
        public void test(){
            System.out.println(age);//内部类可以访问外部成员变量
            int age = 66;
            System.out.println(age);//66
            System.out.println(this.age);//88
            System.out.println(Outer.this.age);//99
        }

        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
    }
    public void test2(){
        System.out.println(age);

    }
}
